package com.chenglu.android.cart.mvp.contract;



import com.chenglu.android.cart.bean.CartBean;
import com.chenglu.android.cart.bean.CartUpdateBean;
import com.chenglu.android.common.base.BaseView;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;

/**
 * @author: lyj
 * @Created by Copyright 2023/3/27 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @description contract
 */
public interface CartContract {

    /**
     *
     * @description model
     *
     */

     interface CartModel{

        Observable<CartBean> getCart(String token);

        Observable<CartUpdateBean> getCartUpadet(String token, RequestBody requestBody);

        Observable<CartUpdateBean> getCartRemove(String token, String ids);
    }


    /**
     *
     * @description view
     *
     */

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void dismissLoading();

        @Override
        void onEmpty(Object tag);

        void onError(String errMessage);

        void onSuccess(CartBean bean);

        void getCartUpadet(CartUpdateBean bean);

        void getCartRemove(CartUpdateBean bean);
    }

    /**
     *
     * @description presenter
     *
     */

    interface CartPresenter {


        void getCart(String token);

        void getCartUpadet(String token, RequestBody requestBody);

        void  getCartRemove(String token, String ids);

    }
}